home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ply15dat.zip / QUARTS.INC < prev    next >
Text File  |  1992-09-05  |  7KB  |  260 lines

  1. // Bicorn
  2. define a 1.0
  3. define bicorn
  4. object {
  5.     object { polynomial  y^2*(a^2 - (x^2 + z^2)) - (x^2 + z^2 + 2*a*y - a^2)^2 }
  6.   & object { box <-3, -3, -0.3>, <3, 3, 0.3> }
  7.   bounding_box <-3, -3, -0.3>, <3, 3, 0.3>
  8.   }
  9.  
  10. // Bifolia
  11. define a 3
  12. define bifolia
  13. object {
  14.      object { polynomial (x^2 + y^2 + z^2)^2 - a*(x^2 + z^2)*y }
  15.    & object { box <-1, -1, -0.1>, <1, 1, 1> }
  16.    bounding_box <-1, -1, -0.1>, <1, 1, 1>
  17.    }
  18.  
  19. // Ovals of Cassini rotated around the y axis
  20. define a 0.45
  21. define b 0.5
  22. define c 16
  23. define cassini
  24. object {
  25.      object { polynomial (x^2 + y^2 + z^2 + a^2)^2 - c*a^2*(x^2 + z^2) - b^2 }
  26.    & object { box <-2, -2, -0.6>, <2, 2, 2> }
  27.    bounding_box <-2, -2, -0.6>, <2, 2, 2>
  28.    scale <2/3, 2/3, 2/3>
  29.    }
  30.  
  31. // A cubic saddle.
  32. define csaddle
  33. object {
  34.      object { polynomial x^3 - y^3 - z }
  35.    & object { box <-1, -1, -1>, <1, 1, 1> }
  36.    bounding_box <-1, -1, -1>, <1, 1, 1>
  37.    scale <5/6, 5/6, 5/6>
  38.    }
  39.  
  40. // Devils curve variant
  41. define devils_curve
  42. object {
  43.      object { polynomial x^4 + 2*x^2*z^2 - 0.36*x^2 - y^4 + 0.25*y^2 + z^4 }
  44.    & object { box <-2, -2, -0.5>, <2, 2, 0.5> }
  45.    bounding_box <-2, -2, -0.5>, <2, 2, 0.5>
  46.    rotate <90, 0, 0>
  47.    scale <2/3, 2/3, 2/3>
  48.    }
  49.  
  50. // Folium
  51. define a 1
  52. define b 1
  53. define folium
  54. object {
  55.      object { polynomial (y^2 + z^2) * (1 + (b - 4*a)*x) + x^2*(1 + b)
  56.               scale <0.1, 0.1, 0.1> }
  57.    & object { box <-1, -1, -1>, <1, 1, 1> }
  58.    bounding_box <-1, -1, -1>, <1, 1, 1>
  59.    }
  60.  
  61. // Hyperbolic torus
  62. define r0 0.6
  63. define r1 0.4
  64. define hyp_torus
  65. object {
  66.    object { polynomial x^4 + 2*x^2*y^2 - 2*x^2*z^2 - 2*(r0^2+r1^2)*x^2 + y^4 -
  67.               2*y^2*z^2 + 2*(r0^2-r1^2)*y^2 + z^4 + 2*(r0^2+r1^2)*z^2 +
  68.               (r0^2-r1^2)^2 }
  69.    &  object { box <-2, -2, -2>, <2, 2, 2> }
  70.    bounding_box <-2, -2, -2>, <2, 2, 2>
  71.    scale <2/3, 2/3, 2/3>
  72.    }
  73.  
  74. // Kampyle of Eudoxus
  75. define a 0.2
  76. define c 1
  77. define kampyle
  78. object {
  79.    object { polynomial (y^2 + z^2) - c^2 * x^4 + c^2 * a^2 * x^2 }
  80.    & object { box <-1, -1, -1>, <1, 1, 1> }
  81.    bounding_box <-1, -1, -1>, <1, 1, 1>
  82.    }
  83.  
  84. // Lemniscate of Gerono
  85. define lemniscate
  86. object {
  87.    polynomial x^4 - x^2 + y^2 + z^2
  88.    bounding_box <-1, -1, -1>, <1, 1, 1>
  89.    }
  90.  
  91. // Two parallel sheets with a blob on the top
  92. define a 10
  93. define c 1
  94. define qloop
  95. object {
  96.    object { polynomial (x^2+y^2+z^2+a*c*x)^2-(x^2+y^2+z^2)*(c-a*x)^2 }
  97.    & object { box <-2, -1, -0.4>, <2, 1, 0.4> }
  98.    bounding_box <-2, -1, -0.4>, <2, 1, 0.4>
  99.    rotate <0, 0, -90>
  100.    rotate <90, 0, 0>
  101.    }
  102.  
  103. // Monkey Saddle
  104. define c 1
  105. define monkey_saddle
  106. object {
  107.    object { polynomial c*(x^3 - 3*x*y^2) - z }
  108.    & object { box <-1, -1, -1>, <1, 1, 1> }
  109.    bounding_box <-1, -1, -1>, <1, 1, 1>
  110.    }
  111.  
  112. // Parabolic Torus
  113. define r0 0.6
  114. define r1 0.5
  115. define par_torus
  116. object {
  117.    object {
  118.    polynomial x^4 + 2*x^2*y^2 - 2*x^2*z - (r0^2+r1^2)*x^2 + y^4 - 2*y^2*z +
  119.               (r0^2-r1^2)*y^2 + z^2 + (r0^2+r1^2)*z + (r0^2-r1^2)^2 }
  120.    & object { box <-2, -2, -2>, <2, 2, 2> }
  121.    bounding_box <-2, -2, -2>, <2, 2, 2>
  122.    scale <2/3, 2/3, 2/3>
  123.    }
  124.  
  125. // Piriform - very nice teardrop shape
  126. define piriform
  127. object {
  128.    object { polynomial (x^4 - x^3) + y^2 + z^2 translate <-0.5, 0, 0> }
  129.    bounding_box <-0.6, -0.6, -0.6>, <0.6, 0.6, 0.6>
  130.    scale <2, 1, 1>
  131.    rotate <0, 90, 0>
  132.    translate <0, 1, 0>
  133.    }
  134.  
  135. // Quartic paraboloid.  Looks like the quadric paraboloid, but is squared
  136. // off on the bottom and sides.
  137. define quart_parab
  138. object {
  139.    object { polynomial x^4 + z^4 - y }
  140.    & object { box <-2, 0, -0.6>, <2, 2, 2> }
  141.    bounding_box <-2, 0, -0.6>, <2, 2, 2>
  142.    scale <2/3, 2/3, 2/3>
  143.    rotate <90, 0, 0>
  144.    }
  145.  
  146. // Quartic saddle - looks like the quadric saddle, but is squared off in
  147. // the middle.  The equation is:
  148. define quart_saddle
  149. object {
  150.    object { polynomial x^4 - z^4 - y }
  151.    & object { box <-1.5, -1.5, -1>, <1.5, 1.3, 1.5> }
  152.    bounding_box <-1.5, -1.5, -1>, <1.5, 1.3, 1.5>
  153.    scale <1/2, 1/2, 1/2>
  154.    rotate <90, 0, 0>
  155.    }
  156.  
  157. // Space Needle?
  158. define a 1
  159. define c 0.1
  160. define space_needle
  161. object {
  162.    object { polynomial (x^2 + z^2) * y^2 + c^2 * (x^2 + z^2) - c^2 * a^2 }
  163.    & object { box <-1, -3, -1>, <1, 3, 1> }
  164.    bounding_box <-1, -3, -1>, <1, 3, 1>
  165.    scale <1/2, 1/2, 1/2>
  166.    rotate <90, 0, 0>
  167.    }
  168.  
  169. // Quartic parabola - a 4th degree polynomial (has two bumps at the bottom)
  170. // that has been swept around the z axis.
  171. define parab4
  172. object {
  173.    object { polynomial 0.1*(x^2 + z^2)^2 - (x^2 + z^2) + 0.9 - y
  174.             scale <0.5, 0.5, 0.5> }
  175.    & object { box <-2, -2, -0.7>, <2, 0.7, 2> }
  176.    bounding_box <-2, -2, -0.7>, <2, 0.7, 2>
  177.    scale <2/3, 2/3, 2/3>
  178.    rotate <90, 0, 0>
  179.    }
  180.  
  181. // Steiners quartic surface.
  182. define steiner
  183. object {
  184.    object { polynomial x^2*y^2 + x^2*z^2 + y^2*z^2 + x*y*z }
  185.    bounding_box <-sqrt(2), -sqrt(2), -sqrt(2)>, <sqrt(2), sqrt(2), sqrt(2)>
  186.    scale <2, 2, 2>
  187.    rotate <-40, -10, 0>
  188.    }
  189.  
  190. // Strophoid
  191. define a 1
  192. define b -0.1
  193. define c 0.4
  194. define strophoid
  195. object {
  196.    object { polynomial (b - x)*(y^2 + z^2) - c^2*a*x^2 - c^2*x^3 }
  197.    & object { box <-1, -1, -1>, <1, 1, 1> }
  198.    bounding_box <-1, -1, -1>, <1, 1, 1>
  199.    rotate <0, 0, -90>
  200.    }
  201.  
  202. // A drop coming out of water? This is a curve formed by using the equation
  203. // x = 1/2 y^2 (y + 1) as the radius of a cylinder having the y-axis as
  204. // its central axis.
  205. define tear3
  206. object {
  207.    object { polynomial y^2 + z^2 - 0.5*(x^3 + x^2) }
  208.    & object { box <-1, -1, -1>, <1, 1, 1> }
  209.    bounding_box <-1, -1, -1>, <1, 1, 1>
  210.    }
  211.  
  212. // Glob - sort of like basic teardrop shape.
  213. define tear5
  214. object {
  215.    object { polynomial  0.5*x^5 + 0.5*x^4 - (y^2 + z^2) }
  216.    & object { box <-1, -1, -1>, <1, 1, 1> }
  217.    bounding_box <-1, -1, -1>, <1, 1, 1>
  218.    }
  219.  
  220. // Torus - basic doughnut shape.  The distance from the origin to the center
  221. // of the ring is "r0", the distance from the center of the ring to the surface
  222. // is "r1".
  223. define r0 0.5
  224. define r1 0.2
  225. define torus_5_2
  226. object {
  227.    object { polynomial (x^2 + y^2 + z^2 - (r0^2 + r1^2))^2 - 4*r0^2*(r1^2-z^2) }
  228.    bounding_box <-(r0+r1), -(r0+r1), -r1>, <r0+r1, r0+r1, r1>
  229.    rotate <90, 0, 0>
  230.    }
  231.  
  232. // Crossed Trough This is a surface with four pieces that sweep up from
  233. // the x-z plane.
  234. define crossed_trough
  235. object {
  236.    object { polynomial x^2*z^2 - y }
  237.    & object { box <-2, 0, -2>, <2, 2, 2> }
  238.    bounding_box <-2, 0, -2>, <2, 2, 2>
  239.    scale <1/2, 1/2, 1/2>
  240.    }
  241.  
  242. // Variant of a lemniscate - the two lobes are much more teardrop-like.
  243. define a 1
  244. define c 2
  245. define twin_glob
  246. object {
  247.    object { polynomial y^2 + z^2 - c^2*a^2*x^4 + c^2*x^6 }
  248.    & object { box <-1, -1, -1>, <1, 1, 1> }
  249.    bounding_box <-1, -1, -1>, <1, 1, 1>
  250.    }
  251.  
  252. // Witch of Agnesi
  253. define a 0.04
  254. define witch_agnesi
  255. object {
  256.    object { polynomial a * (y - 1) + (x^2 + z^2) * y }
  257.    & object { sphere <0, 0, 0>, 1 }
  258.    bounding_box <-1, -1, -1>, <1, 1, 1>
  259.    }
  260.